package org.jeecg.modules.dzswj.exception;

import org.jeecg.common.exception.JeecgBootException;

/**
 * @author chensherun on 2022/3/11.
 * @version 1.0
 */
public class SmdlException extends JeecgBootException {

    private ErrorCode errorCode;

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public enum ErrorCode {
        UN_AUTH("001","企业未授权"),
        LOGIN_FAIL("002", "登录失败");

        private String code;
        private String msg;
        ErrorCode(String code, String msg) {
            this.code = code;
            this.msg = msg;
        }


        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }
    }

    public SmdlException(String message) {
        super(message);
    }

    public SmdlException(ErrorCode errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
    }

    public SmdlException(Throwable cause) {
        super(cause);
    }

    public SmdlException(String message, Throwable cause) {
        super(message, cause);
    }
}
